package controller.MenuActions;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.KeyStroke;

import model.Constants;
import view.themas.ThemaFactory;
import controller.PresentatieController;

/**
 * 
 *  Deze klasse is verantwoordelijk voor de acties die geassocieerd zijn met het
 * themamenu
 *
 */

public class ThemaAction extends AbstractAction {

	private String thema = Constants.STANDAARDTHEMA;
	private ThemaFactory themaFactory = new ThemaFactory();

	private static final long serialVersionUID = 1L;

	@Override
	public void actionPerformed(ActionEvent e) {
		switch (thema) {

		case (Constants.STANDAARDTHEMA):
			PresentatieController.presentatie.setThema(themaFactory
					.createDefaultThema());
			break;
		case (Constants.COLORFULLTHEMA):
			PresentatieController.presentatie.setThema(themaFactory
					.createColorFullThema());
			break;
		case (Constants.COMPLEXTHEMA):
			PresentatieController.presentatie.setThema(themaFactory
					.createComplexThema());
		}
	}

	public ThemaAction(String name, String shortDescription, Integer mnemonic,
			KeyStroke key) {
		super(name, null);
		putValue(SHORT_DESCRIPTION, shortDescription);
		putValue(MNEMONIC_KEY, mnemonic);
		putValue(ACCELERATOR_KEY, key);
		this.thema = name;
	}
}
